Split a string containing Date and Time into two separate Arrays.
#include <date.au3>
_DateTimeSplit($sDate, ByRef $asDatePart, ByRef $iTimePart)
Parameters
$sDate | Any of these formats: "yyyy/mm/dd[ hh:mm[:ss]]" "yyyy/mm/dd[Thh:mm[:ss]]" "yyyy-mm-dd[ hh:mm[:ss]]" "yyyy-mm-dd[Thh:mm[:ss]]" "yyyy.mm.dd[ hh:mm[:ss]]" "yyyy.mm.dd[Thh:mm[:ss]]" |
$asDatePart | array that contains the Date. $asDatePart[0] number of values returned |
$asTimePart | array that contains the Time. $asTimePart[0] number of values returned |
Return Value
Success: | Date and Time into two separate Arrays. |
Failure: | 0 |
@Error: | 0 = No error. |
1 = Invalid Input Date |
Remarks
None.
Related
_DayValueToDate, _DateAdd, _DateDiff
Example
#include <Date.au3>
Dim $MyDate
Dim $MyTime
_DateTimeSplit("2005/01/01 14:30",$MyDate,$MyTime)
For $x = 1 to $MyDate[0]
MsgBox(0,$x,$MyDate[$x])
Next
For $x = 1 to $MyTime[0]
MsgBox(0,$x,$MyTime[$x])
Next